<#include "../header.ftl">
<html>

<body>

<#include "../nav-top.ftl">
<div class="sui-container" style="margin-top: 30px;">
    <ul class="sui-breadcrumb" style="padding: 0px 0px">
        <li><a href="#">消息管理</a></li>
        <li class="active">消息发布</li>
    </ul>
    <div class="sui-row-fluid">
        <div class="span1">
            <ul class="sui-nav nav-list nav-xlarge nav-user-type">
                <li class="active" data-type="nav-wait"><a>待发布</a></li>
                <li data-type="nav-release"><a>已发布</a></li>
                <li data-type="nav-save"><a>暂存</a></li>
            </ul>
        </div>
        <div class="span11 nav-wait nav-my-tabs">
            <form id="form-msg" class="sui-form form-horizontal" novalidate="novalidate">
                <div class="control-group">
                    <label for="msgTitle1">标　　题：</label>
                    <div class="controls">
                        <input type="text" id="msgTitle1" name="msgTitle1" placeholder="标题" class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgContent1">内　　容：</label>
                    <div class="controls">
                        <input type="text" id="msgContent1" name="msgContent1" placeholder="内容" class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgType1">类　　型：</label>
                    <div class="controls">
                        <select class="input-large" id="msgType1">
                            <option value="">全部</option>
                        <#list messagesType as type>
                            <option value="${type.codeValue}">${type.codeName}</option>
                        </#list>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label for="beginTime1">开始日期：</label>
                    <div class="controls">
                        <input type="text" id="beginTime1" name="beginTime1" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <label for="endTime1">结束日期：</label>
                    <div class="controls">
                        <input type="text" id="endTime1" name="endTime1" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large query-sending">查询</a>&nbsp;
                    <button data-toggle="modal" data-target="#addMsg" data-keyboard="false" class="sui-btn btn-large"
                            data-width="large">新增
                    </button>
                    &nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large del-sending-all">删除</a>&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large release-msg-sending-all">发布</a>
                </div>
            </form>
            <table class="sui-table table-bordered rowover-table" id="tab-sending">
                <thead>
                <tr>
                    <th><input type="checkbox" class="check-all-sending"/></th>
                    <th>标题</th>
                    <th>内容</th>
                    <th>类型</th>
                    <th>创建日期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
            <div class="sui-pagination pagination-large sending-pagination" style="float: right">
                <ul>
                    <li class="prev disabled"><a href="#">«上一页</a></li>
                    <li class="next"><a href="#">下一页»</a></li>
                </ul>
            </div>
        </div>
        <div class="span11 nav-my-tabs nav-release " style="display: none">
            <form id="form-msg" class="sui-form form-horizontal" novalidate="novalidate">
                <div class="control-group">
                    <label for="msgSendedTitle">标　　题：</label>
                    <div class="controls">
                        <input type="text" id="msgSendedTitle" name="msgSendedTitle" placeholder="标题"
                               class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgSendedContent">内　　容：</label>
                    <div class="controls">
                        <input type="text" id="msgSendedContent" name="msgSendedContent" placeholder="内容"
                               class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgType2">类　　型：</label>
                    <div class="controls">
                        <select class="input-large" id="msgType2">
                            <option value="">全部</option>
                        <#list messagesType as type>
                            <option value="${type.codeValue}">${type.codeName}</option>
                        </#list>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label for="beginTime2">开始日期：</label>
                    <div class="controls">
                        <input type="text" id="beginTime2" name="beginTime2" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <label for="endTime2">结束日期：</label>
                    <div class="controls">
                        <input type="text" id="endTime2" name="endTime2" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large query-release">查询</a>&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large del-release-all">删除</a>&nbsp;
                    <a href="/group/add" class="sui-btn btn-large">再次发布</a>
                </div>
            </form>
            <table class="sui-table table-bordered rowover-table" id="tab-release">
                <thead>
                <tr>
                    <th><input type="checkbox" class="check-all-release"/></th>
                    <th>标题</th>
                    <th>内容</th>
                    <th>类型</th>
                    <th>创建日期</th>
                    <th>发布日期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
            <div class="sui-pagination pagination-large release-pagination" style="float: right">
                <ul>
                    <li class="prev disabled"><a href="#">«上一页</a></li>
                    <li class="next"><a href="#">下一页»</a></li>
                </ul>
            </div>
        </div>
        <div class="span11 nav-my-tabs nav-save" style="display: none">
            <form id="form-msg" class="sui-form form-horizontal" novalidate="novalidate">
                <div class="control-group">
                    <label for="msgTitle3">标　　题：</label>
                    <div class="controls">
                        <input type="text" id="msgTitle3" name="msgTitle3" placeholder="标题" class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgContent3">内　　容：</label>
                    <div class="controls">
                        <input type="text" id="msgContent3" name="msgContent3" placeholder="内容" class="input-large">
                    </div>
                    &nbsp;&nbsp;
                    <label for="msgType3">类　　型：</label>
                    <div class="controls">
                        <select class="input-large" id="msgType3">
                            <option value="">全部</option>
                        <#list messagesType as type>
                            <option value="${type.codeValue}">${type.codeName}</option>
                        </#list>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label for="beginTime3">开始日期：</label>
                    <div class="controls">
                        <input type="text" id="beginTime3" name="beginTime3" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <label for="endTime3">结束日期：</label>
                    <div class="controls">
                        <input type="text" id="endTime3" name="endTime3" class="input-large"
                               data-toggle="datepicker">
                    </div>
                    &nbsp;&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large query-save">查询</a>&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large del-save-all">删除</a>&nbsp;
                    <a href="javascript:void(0)" class="sui-btn btn-large release-msg-save-all">发布</a>
                </div>
            </form>
            <table class="sui-table table-bordered  rowover-table" id="tab-save">
                <thead>
                <tr>
                    <th><input type="checkbox" class="check-all-save"/></th>
                    <th>标题</th>
                    <th>内容</th>
                    <th>类型</th>
                    <th>创建日期</th>
                    <th>暂存日期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
            <div class="sui-pagination pagination-large save-pagination" style="float: right">
                <ul>
                    <li class="prev disabled"><a href="#">«上一页</a></li>
                    <li class="next"><a href="#">下一页»</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div id="addMsg" tabindex="-1" role="dialog" data-hasfoot="false" class="sui-modal hide fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" aria-hidden="true" class="sui-close">×</button>
                <h4 id="myModalLabel" class="modal-title">新增消息</h4>
            </div>
            <div class="modal-body">

                <form id="form-addmsg" class="sui-form form-horizontal" novalidate="novalidate">
                    <div class="control-group">
                        <label for="msgTitle">标　　题：</label>
                        <div class="controls">
                            <input type="text" class="input-xxlarge" id="msgTitle" name="msgTitle" placeholder="标题">
                        </div>
                    </div>
                    <div class="control-group">
                        <label for="msgType">消息类型：</label>
                        <div class="controls">
                            <select class="input-xxlarge" id="msgType" name="msgType">
                            <#list messagesType as type>
                                <option value="${type.codeValue}">${type.codeName}</option>
                            </#list>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label for="msgContent">内　　容：</label>
                        <div class="controls">
                            <textarea rows="3" class="input-xxlarge" maxlength="100" id="msgContent"
                                      name="msgContent"></textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <button type="button" class="sui-btn btn-xlarge btn-primary add-save">暂存</button>
                        &nbsp;&nbsp;
                        <button type="button" class="sui-btn btn-xlarge btn-info add-sending">提交</button>
                    </div>
                </form>

            </div>

        </div>
    </div>
</div>
<#include "../footer.ftl">
<script src="../../static/js/plugins/sea/sea.js"></script>
<script src="../../static/js/sea.config.js"></script>
<script>
    seajs.use('/static/js/game/messages/list');

</script>
<script id="tp-sending" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var msg = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="sending-msg-id" value=" <%= msg.msgId %>"</td>
        <td><%= msg.msgTitle %></td>
        <td><%= msg.msgContent %></td>
        <td><%= msg.msgTypeName %></td>
        <td><%= dateFormat(msg.sendTime,'yyyy-MM-dd') %></td>
        <td>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small ">查看</a>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small del-sending"
               data-id="<%= msg.msgId %>" data-name="<%= msg.msgTitle %>">删除</a>
            <a href="javascript:void(0);" data-id="<%= msg.msgId %>"
               class="sui-btn btn-link btn-small release-msg">发布</a>
        </td>
    </tr>
    <% } %>
</script>

<script id="tp-save" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var msg = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="save-msg-id" value=" <%= msg.msgId %>"</td>
        <td><%= msg.msgTitle %></td>
        <td><%= msg.msgContent %></td>
        <td><%= msg.msgTypeName %></td>
        <td><%= dateFormat(msg.sendTime,'yyyy-MM-dd') %></td>
        <td><%= msg.saveTime==null?'':dateFormat(msg.saveTime,'yyyy-MM-dd') %></td>
        <td>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small ">查看</a>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small del-save"
               data-id="<%= msg.msgId %>" data-name="<%= msg.msgTitle %>">删除</a>
            <a href="javascript:void(0);" data-id="<%= msg.msgId %>"
               class="sui-btn btn-link btn-small release-msg">发布</a>
        </td>
    </tr>
    <% } %>
</script>

<script id="tp-release" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var msg = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="release-msg-id" value=" <%= msg.msgSendedId %>"</td>
        <td><%= msg.msgSendedTitle %></td>
        <td><%= msg.msgSendedContent %></td>
        <td><%= msg.msgTypeName %></td>
        <td><%= dateFormat(msg.sendTime,'yyyy-MM-dd') %></td>
        <td><%= msg.saveTime==null?'':dateFormat(msg.saveTime,'yyyy-MM-dd') %></td>
        <td>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small ">查看</a>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small del-release"
               data-id="<%= msg.msgSendedId %>" data-name="<%= msg.msgSendedTitle %>">删除</a>
            <a href="javascript:void(0);" class="sui-btn btn-link btn-small ">发布</a>
        </td>
    </tr>
    <% } %>
</script>
</body>
</html>
